package com.jayqqaa12.abase.util.ui;

import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.content.res.Configuration;

import com.jayqqaa12.abase.core.AbaseUtil;
import com.jayqqaa12.abase.util.ManageUtil;

public class ScreenUtil extends AbaseUtil
{
	

	/**
	 * 返回当前屏幕是否为竖屏。
	 * 
	 * @param context
	 * @return 当且仅当当前屏幕为竖屏时返回true,否则返回false。
	 */
	public static boolean isScreenOriatationPortrait(Context context)
	{
		return context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;

	}

	
	/**
	 *  锁屏 并 设置 密码
	 * 
	 * @param password
	 */
	public static void setLockScreen(String password)
	{
		DevicePolicyManager manager = ManageUtil.getDevicePolicyManager();
		manager.resetPassword(password, 0);
		manager.lockNow();
	}

}
